// src/store/index.js
import {applyMiddleware, createStore} from "redux";
import {composeWithDevTools} from "@redux-devtools/extension";
import rootReducer from "@reducers/rootReducer";
import thunk from "redux-thunk";

const middlewares = [thunk];

const enhancers =
    process.env.NODE_ENV === "production"
        ? applyMiddleware(...middlewares)
        : composeWithDevTools(applyMiddleware(...middlewares));

const store = createStore(rootReducer, enhancers);

export default store;